extends layout

block content
  include includes/header.pug
  .container
    if username
      .row
        .card.mt-1.mb-1.col-12
          .card-body
            form(action="/images/", method="post", enctype="multipart/form-data")
              .form-group.row
                label.col-12.col-md-2 浏览
                input.col-12.col-md-10.form-control-file(type='file',name='imgfile')
              .form-group.row
                label.col-12.col-md-2 标题
                input.col-12.col-md-10.form-control(type='text', name='title')
              .form-group.row
                label.col-12.col-md-2 描述
                input.col-12.col-md-10.form-control(type='text', name='description')
              .form-group.row
                .col-12.offset-md-8.col-md-4
                  button.btn.btn-primary.btn-block(type='submit') 提交
    .row
      each com in leastCom
        a.list-group-item.col-12
          h4.list-group-item-heading= com.nickname
          p.list-group-item-text= com.comment
    .row
      each image in images
        a.col-6.col-md-4(href=`/images/${image._id}`)
          .card
            img.card-img-top(src=`/uploads/${image.diskfilename}`, alt=image.title)
            .card-body
              h5.card-title= image.title
              p.card-text= image.description
    include includes/footer.pug
      
  //- script(src='https://code.jquery.com/jquery-3.2.1.slim.min.js', integrity='sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN', crossorigin='anonymous')
  //- script.
  //-   window.jQuery || document.write('<script src="../../../../assets/js/vendor/jquery-slim.min.js"><\\/script>')
  //- script(src='../../../../assets/js/vendor/popper.min.js')
  //- script(src='../../../../dist/js/bootstrap.min.js')
  //- script(src='../../../../assets/js/vendor/holder.min.js')
  script.
    Holder.addTheme('thumb', {
    bg: '#55595c',
    fg: '#eceeef',
    text: 'Thumbnail'
    });